package com.hmall.common.clients;

import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "itemservice")
public interface ItemClient {
    /**
     * 分页查询商品数据
     * @param page
     * @param size
     * @return
     */
    @GetMapping("/item/list")
    PageDTO<Item> searchItemByPage(@RequestParam("page") Long page, @RequestParam("size") Long size);

    /**
     * 根据id查询商品
     *
     * @param id
     * @return
     */
    @GetMapping("/item/{id}")
    Item searchItemById(@PathVariable Long id);
}
